@extends('Admin.layout.layout')
@section('title')
<title>lamp178官网 - 后台用户列表</title>
@endsection
@section('con')
   <div class="row">
                <div class="col-lg-12">
                    <h1 class="page-header">用户列表</h1>
                </div>
           
            </div>
         
   <div class="panel-body">
   
                            <div class="dataTable_wrapper">
                                <div id="dataTables-example_wrapper" class="dataTables_wrapper form-inline dt-bootstrap no-footer">
                                 <form action="{{url('/admin/shisheng/index')}}" method="get">
                                <div class="row">

                                <div class="col-sm-6">
                                 <div id="dataTables-example_filter" class="dataTables_filter">
                                   <label>查询:<input type="search" name="keywords" value="{{ $data['keywords'] or '' }}" class="form-control input-sm" placeholder="" aria-controls="dataTables-example" /></label>
                                    <button class="btn">搜索</button>
                                </div></div></div>
                                </form>

                                <div class="row">
                                <div class="col-sm-12">
                                <table class="table table-striped table-bordered table-hover dataTable no-footer" id="dataTables-example" role="grid" aria-describedby="dataTables-example_info">
                                    <thead>
                                        <tr role="row">
                                        <th class="sorting_asc" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" aria-sort="ascending" aria-label="Rendering engine: activate to sort column descending" style="width: 80px;">ID</th>
                                        <th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">式神名</th>
                                        <th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" aria-label="Platform(s): activate to sort column ascending" style="width: 80px;">式神觉醒前图片</th>
                                        <th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" aria-label="Engine version: activate to sort column ascending" style="width: 80px;">式神觉醒后图片</th>
                                        <th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">等级</th>
                                        <th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">攻击</th>
                                        <th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">防御</th>
                                        <th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">生命</th>
                                        <th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">速度</th>
                                        <th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">暴击</th>
                                        <th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">暴击伤害</th>
                                        <th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">效果命中</th>
                                        <th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">效果抵抗</th>
                                        <th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">技能图片1</th>
                                        <th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">技能名1</th>
                                        <th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">技能图片2</th>
                                        <th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">技能名2</th>
                                        <th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">技能图片3</th>
                                        <th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">技能名3</th>
                                        <th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" aria-label="CSS grade: activate to sort column ascending" style="width: 94px;">操作</th></tr>
                                    </thead>
                                   <tbody>
                                    

                                    @foreach($users as $k=>$v)
                                           
                                          
                                             <tr class="gradeA odd" role="row">
                                                    <td class="sorting_1">{{$v->id}}</td>
                                                    <td>{{$v->username}}</td>
                                                    <td><img src="{{asset($v->img)}}"  class="img-circle" style="width:50px;height:50px "></td>
                                                     <td><img src="{{asset($v->pic)}}"  class="img-circle" style="width:50px;height:50px "></td>
                                                    <td>{{$v->grade}}</td>
                                                    <td>{{$v->gongji}}</td>
                                                    <td>{{$v->fangyu}}</td>
                                                    <td>{{$v->shengming}}</td>
                                                    <td>{{$v->sudu}}</td>
                                                    <td>{{$v->baoji}}</td>
                                                    <td>{{$v->shanghai}}</td>
                                                    <td>{{$v->mingzhong}}</td>
                                                    <td>{{$v->dikang}}</td>
                                                    <td><img src="{{asset($v->jineng1)}}"  class="img-circle" style="width:50px;height:50px "></td>
                                                    <td>{{$v->jineng11}}</td>
                                                    <td><img src="{{asset($v->jineng2)}}"  class="img-circle" style="width:50px;height:50px "></td>
                                                    <td>{{$v->jineng22}}</td>
                                                    <td><img src="{{asset($v->jineng3)}}" class="img-circle" style="width:50px;height:50px "></td>
                                                    <td>{{$v->jineng33}}</td>
                                                   
                                                   <td class="center">
                                                        <button id="shanchu" class="btn btn-danger btn-xs btn-delete" type="button">删除</button>
                                                       
                                             <a class="btn btn-warning btn-xs" href="{{url('/admin/shisheng/edit',['id'=>$v->id])}}">修改</a>
                                              <!--  <span aria-hidden="true" class="btn btn-warning btn-xs" data-toggle="modal"  data-target="#myModal">修改{{$id=$v->id}}</span>-->
                                             
                                    
                                                </td> 
                                                  
                                                </tr> 
                                    
                                         @endforeach 
                                    
                                    
                                           

                              
                                        </tbody> 
                                </table></div></div>
                                <div class="col-sm-8" style="left:70%">
                             {!! $users->appends($data)->render() !!}
</div>
                       
                          
                           
                        </div>
@endsection
@section('js')
<script type="text/javascript">
    $.ajaxSetup({
            headers: {
                'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
            }
    });


    $('.btn-delete').click(function(){
      var id = $(this).parents('tr').find('.sorting_1').text();
      var btn = $(this);


      $.get('/admin/shisheng/del',{id:id},function(data){
            if(data == 1){
              btn.parents('tr').remove();
        }else{
                alert('删除失败');
            }
      });

    })
  
</script>
@endsection
